

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>对象操作 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="S3 的 C++ 接口实例" href="../cpp/" />
    <link rel="prev" title="桶操作" href="../bucketops/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 对象网关</a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 对象网关的 S3 API</a></li>
      <li class="breadcrumb-item active">对象操作</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/radosgw/s3/objectops.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 对象网关</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../frontends/">HTTP 前端</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../multisite/">多站配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../zone-features/">域的功能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../placement/">存储池归置与存储类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../multisite-sync-policy/">多站同步策略配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../pools/">存储池的配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../config-ref/">配置参考</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../admin/">管理指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../account/">用户账户</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">S3 API</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="../#api">API</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="../commons/">常见的</a></li>
<li class="toctree-l4"><a class="reference internal" href="../authentication/">认证</a></li>
<li class="toctree-l4"><a class="reference internal" href="../serviceops/">Service Ops</a></li>
<li class="toctree-l4"><a class="reference internal" href="../bucketops/">Bucket Ops</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">Object Ops</a></li>
<li class="toctree-l4"><a class="reference internal" href="../cpp/">C++</a></li>
<li class="toctree-l4"><a class="reference internal" href="../csharp/">C#</a></li>
<li class="toctree-l4"><a class="reference internal" href="../java/">Java</a></li>
<li class="toctree-l4"><a class="reference internal" href="../perl/">Perl</a></li>
<li class="toctree-l4"><a class="reference internal" href="../php/">PHP</a></li>
<li class="toctree-l4"><a class="reference internal" href="../python/">Python</a></li>
<li class="toctree-l4"><a class="reference internal" href="../ruby/">Ruby AWS::SDK Examples (aws-sdk gem ~&gt;2)</a></li>
<li class="toctree-l4"><a class="reference internal" href="../ruby/#ruby-aws-s3-examples-aws-s3-gem">Ruby AWS::S3 Examples (aws-s3 gem)</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../#id1">功能支持情况</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#header">不支持的 Header 字段</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../iam/">IAM API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../rgw-cache/">数据缓存和 CDN</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../swift/">Swift API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../adminops/">管理操作 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">Python 接口</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../nfs/">通过 NFS 导出</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../keystone/">与 OpenStack Keystone 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../barbican/">与 OpenStack Barbican 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../vault/">与 HashiCorp Vault 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../kmip/">与 KMIP 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../opa/">与 Open Policy Agent 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../multitenancy/">多租户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../compression/">压缩</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../ldap-auth/">LDAP 认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../encryption/">服务器端加密</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../bucketpolicy/">桶策略</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../dynamicresharding/">动态的桶索引重分片</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../mfa/">多因子认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../sync-modules/">同步模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../notifications/">Bucket Notifications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../layout/">RADOS 中的数据布局</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../STS/">STS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../STSLite/">STS Lite</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../keycloak/">Keycloak</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../session-tags/">Session Tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../role/">Role</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../orphans/">Orphan List and Associated Tooliing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../oidc/">OpenID Connect Provider</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../man/8/radosgw/">radosgw 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../man/8/radosgw-admin/">radosgw-admin 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../qat-accel/">使用 QAT 为加密和压缩提速</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../s3select/">S3-select</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../lua-scripting/">Lua Scripting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../d3n_datacache/">D3N Data Cache</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../cloud-transition/">Cloud Transition</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../metrics/">Metrics</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../uadk-accel/">UADK Acceleration for Compression</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../bucket_logging/">桶的日志记录</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="id1">
<h1>对象操作<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h1>
<section id="id2">
<h2>上传对象<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p>把一个对象加进桶里。你必须有这个桶的写权限才能执行这个操作。</p>
<section id="id3">
<h3>语法<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">PUT</span> <span class="o">/</span><span class="p">{</span><span class="n">bucket</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="nb">object</span><span class="p">}</span> <span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span>
</pre></div>
</div>
</section>
<section id="id4">
<h3>请求头<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>Valid Values</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>content-md5</strong></p></td>
<td><p>A base64 encoded MD-5 hash of the message.</p></td>
<td><p>A string. No defaults or constraints.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>content-type</strong></p></td>
<td><p>A standard MIME type.</p></td>
<td><p>Any MIME type. Default: <code class="docutils literal notranslate"><span class="pre">binary/octet-stream</span></code></p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>x-amz-meta-&lt;…&gt;</strong></p></td>
<td><p>User metadata.  Stored with the object.</p></td>
<td><p>A string up to 8kb. No defaults.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>x-amz-acl</strong></p></td>
<td><p>A canned ACL.</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">private</span></code>, <code class="docutils literal notranslate"><span class="pre">public-read</span></code>, <code class="docutils literal notranslate"><span class="pre">public-read-write</span></code>, <code class="docutils literal notranslate"><span class="pre">authenticated-read</span></code></p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id5">
<h2>复制对象<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h2>
<p>复制对象用 <code class="docutils literal notranslate"><span class="pre">PUT</span></code> ，并指定一个目标桶和目标对象名字。</p>
<section id="id6">
<h3>语法<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">PUT</span> <span class="o">/</span><span class="p">{</span><span class="n">dest</span><span class="o">-</span><span class="n">bucket</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="n">dest</span><span class="o">-</span><span class="nb">object</span><span class="p">}</span> <span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span>
<span class="n">x</span><span class="o">-</span><span class="n">amz</span><span class="o">-</span><span class="n">copy</span><span class="o">-</span><span class="n">source</span><span class="p">:</span> <span class="p">{</span><span class="n">source</span><span class="o">-</span><span class="n">bucket</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="n">source</span><span class="o">-</span><span class="nb">object</span><span class="p">}</span>
</pre></div>
</div>
</section>
<section id="id7">
<h3>请求头<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>Valid Values</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>x-amz-copy-source</strong></p></td>
<td><p>The source bucket name + object name.</p></td>
<td><p>{bucket}/{obj}</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><strong>x-amz-acl</strong></p></td>
<td><p>A canned ACL.</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">private</span></code>,
<code class="docutils literal notranslate"><span class="pre">public-read</span></code>,
<code class="docutils literal notranslate"><span class="pre">public-read-write</span></code>,
<code class="docutils literal notranslate"><span class="pre">authenticated-read</span></code></p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>x-amz-copy-if-modified-since</strong></p></td>
<td><p>Copies only if modified since the timestamp.</p></td>
<td><p>Timestamp</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>x-amz-copy-if-unmodified-since</strong></p></td>
<td><p>Copies only if unmodified since the timestamp.</p></td>
<td><p>Timestamp</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>x-amz-copy-if-match</strong></p></td>
<td><p>Copies only if object ETag matches ETag.</p></td>
<td><p>Entity Tag</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>x-amz-copy-if-none-match</strong></p></td>
<td><p>Copies only if object ETag doesn’t match.</p></td>
<td><p>Entity Tag</p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id8">
<h3>响应内容解析<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>CopyObjectResult</strong></p></td>
<td><p>Container</p></td>
<td><p>A container for the response elements.</p></td>
</tr>
<tr class="row-odd"><td><p><strong>LastModified</strong></p></td>
<td><p>Date</p></td>
<td><p>The last modified date of the source object.</p></td>
</tr>
<tr class="row-even"><td><p><strong>Etag</strong></p></td>
<td><p>String</p></td>
<td><p>The ETag of the new object.</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id9">
<h2>删除对象<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h2>
<p>删除一个对象，需要有对象所在桶的 <strong>写权限</strong> 。</p>
<section id="id10">
<h3>语法<a class="headerlink" href="#id10" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DELETE</span> <span class="o">/</span><span class="p">{</span><span class="n">bucket</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="nb">object</span><span class="p">}</span> <span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span>
</pre></div>
</div>
</section>
</section>
<section id="id11">
<h2>下载对象<a class="headerlink" href="#id11" title="Permalink to this heading"></a></h2>
<p>从 RADOS 内的一个桶里取回一个对象。</p>
<section id="id12">
<h3>语法<a class="headerlink" href="#id12" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">GET</span> <span class="o">/</span><span class="p">{</span><span class="n">bucket</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="nb">object</span><span class="p">}</span> <span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span>
</pre></div>
</div>
</section>
<section id="id13">
<h3>请求头<a class="headerlink" href="#id13" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>Valid Values</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>range</strong></p></td>
<td><p>The range of the object to retrieve.</p></td>
<td><p>Range: bytes=beginbyte-endbyte</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>if-modified-since</strong></p></td>
<td><p>Gets only if modified since the timestamp.</p></td>
<td><p>Timestamp</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>if-unmodified-since</strong></p></td>
<td><p>Gets only if not modified since the timestamp.</p></td>
<td><p>Timestamp</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>if-match</strong></p></td>
<td><p>Gets only if object ETag matches ETag.</p></td>
<td><p>Entity Tag</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>if-none-match</strong></p></td>
<td><p>Gets only if object ETag matches ETag.</p></td>
<td><p>Entity Tag</p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id14">
<h3>响应头<a class="headerlink" href="#id14" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>Content-Range</strong></p></td>
<td><p>Data range, will only be returned if the range header field was specified in the request</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id15">
<h2>查看对象信息<a class="headerlink" href="#id15" title="Permalink to this heading"></a></h2>
<p>返回对象的信息。这个请求会返回和“下载对象”请求一样的头部信息，
却只包含元数据，没有对象数据载荷。</p>
<section id="id16">
<h3>语法<a class="headerlink" href="#id16" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">HEAD</span> <span class="o">/</span><span class="p">{</span><span class="n">bucket</span><span class="p">}</span><span class="o">/</span><span class="p">{</span><span class="nb">object</span><span class="p">}</span> <span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span>
</pre></div>
</div>
</section>
<section id="id17">
<h3>请求头<a class="headerlink" href="#id17" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>Valid Values</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>range</strong></p></td>
<td><p>The range of the object to retrieve.</p></td>
<td><p>Range: bytes=beginbyte-endbyte</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>if-modified-since</strong></p></td>
<td><p>Gets only if modified since the timestamp.</p></td>
<td><p>Timestamp</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>if-unmodified-since</strong></p></td>
<td><p>Gets only if not modified since the timestamp.</p></td>
<td><p>Timestamp</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>if-match</strong></p></td>
<td><p>Gets only if object ETag matches ETag.</p></td>
<td><p>Entity Tag</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>if-none-match</strong></p></td>
<td><p>Gets only if object ETag matches ETag.</p></td>
<td><p>Entity Tag</p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="acl">
<h2>查看对象的 ACL<a class="headerlink" href="#acl" title="Permalink to this heading"></a></h2>
<section id="id18">
<h3>语法<a class="headerlink" href="#id18" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{bucket}/{object}?acl HTTP/1.1
</pre></div>
</div>
</section>
<section id="id19">
<h3>响应内容解析<a class="headerlink" href="#id19" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">AccessControlPolicy</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the response.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">AccessControlList</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the ACL information.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Owner</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the object owner’s <code class="docutils literal notranslate"><span class="pre">ID</span></code> and <code class="docutils literal notranslate"><span class="pre">Display名称</span></code>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ID</span></code></p></td>
<td><p>String</p></td>
<td><p>The object owner’s ID.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Display名称</span></code></p></td>
<td><p>String</p></td>
<td><p>The object owner’s display name.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Grant</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for <code class="docutils literal notranslate"><span class="pre">Grantee</span></code> and <code class="docutils literal notranslate"><span class="pre">Permission</span></code>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Grantee</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the <code class="docutils literal notranslate"><span class="pre">Display名称</span></code> and <code class="docutils literal notranslate"><span class="pre">ID</span></code> of the user receiving a grant of permission.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Permission</span></code></p></td>
<td><p>String</p></td>
<td><p>The permission given to the <code class="docutils literal notranslate"><span class="pre">Grantee</span></code> object.</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id20">
<h2>设置对象的 ACL<a class="headerlink" href="#id20" title="Permalink to this heading"></a></h2>
<section id="id21">
<h3>语法<a class="headerlink" href="#id21" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{bucket}/{object}?acl
</pre></div>
</div>
</section>
<section id="id22">
<h3>请求实体<a class="headerlink" href="#id22" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">AccessControlPolicy</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the response.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">AccessControlList</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the ACL information.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Owner</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the object owner’s <code class="docutils literal notranslate"><span class="pre">ID</span></code> and <code class="docutils literal notranslate"><span class="pre">Display名称</span></code>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ID</span></code></p></td>
<td><p>String</p></td>
<td><p>The object owner’s ID.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Display名称</span></code></p></td>
<td><p>String</p></td>
<td><p>The object owner’s display name.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Grant</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for <code class="docutils literal notranslate"><span class="pre">Grantee</span></code> and <code class="docutils literal notranslate"><span class="pre">Permission</span></code>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Grantee</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the <code class="docutils literal notranslate"><span class="pre">Display名称</span></code> and <code class="docutils literal notranslate"><span class="pre">ID</span></code> of the user receiving a grant of permission.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Permission</span></code></p></td>
<td><p>String</p></td>
<td><p>The permission given to the <code class="docutils literal notranslate"><span class="pre">Grantee</span></code> object.</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id23">
<h2>初始化分段上传<a class="headerlink" href="#id23" title="Permalink to this heading"></a></h2>
<p>初始化一个分段上传进程。</p>
<section id="id24">
<h3>语法<a class="headerlink" href="#id24" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{bucket}/{object}?uploads
</pre></div>
</div>
</section>
<section id="id25">
<h3>请求头<a class="headerlink" href="#id25" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>Valid Values</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>content-md5</strong></p></td>
<td><p>A base64 encoded MD-5 hash of the message.</p></td>
<td><p>A string. No defaults or constraints.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>content-type</strong></p></td>
<td><p>A standard MIME type.</p></td>
<td><p>Any MIME type. Default: <code class="docutils literal notranslate"><span class="pre">binary/octet-stream</span></code></p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>x-amz-meta-&lt;…&gt;</strong></p></td>
<td><p>User metadata.  Stored with the object.</p></td>
<td><p>A string up to 8kb. No defaults.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>x-amz-acl</strong></p></td>
<td><p>A canned ACL.</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">private</span></code>, <code class="docutils literal notranslate"><span class="pre">public-read</span></code>, <code class="docutils literal notranslate"><span class="pre">public-read-write</span></code>, <code class="docutils literal notranslate"><span class="pre">authenticated-read</span></code></p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id26">
<h3>响应内容解析<a class="headerlink" href="#id26" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">InitiatedMultipartUploadsResult</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the results.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Bucket</span></code></p></td>
<td><p>String</p></td>
<td><p>The bucket that will receive the object contents.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Key</span></code></p></td>
<td><p>String</p></td>
<td><p>The key specified by the <code class="docutils literal notranslate"><span class="pre">key</span></code> request parameter (if any).</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">UploadId</span></code></p></td>
<td><p>String</p></td>
<td><p>The ID specified by the <code class="docutils literal notranslate"><span class="pre">upload-id</span></code> request parameter identifying the multipart upload (if any).</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id27">
<h2>分段上传其中一块<a class="headerlink" href="#id27" title="Permalink to this heading"></a></h2>
<section id="id28">
<h3>语法<a class="headerlink" href="#id28" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{bucket}/{object}?partNumber=&amp;uploadId= HTTP/1.1
</pre></div>
</div>
</section>
<section id="http">
<h3>HTTP 响应<a class="headerlink" href="#http" title="Permalink to this heading"></a></h3>
<p>会返回下面的 HTTP 响应：</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>HTTP Status</p></th>
<th class="head"><p>Status Code</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>404</strong></p></td>
<td><p>NoSuchUpload</p></td>
<td><p>Specified upload-id does not match any initiated upload on this object</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id29">
<h2>罗列分段上传的数据块<a class="headerlink" href="#id29" title="Permalink to this heading"></a></h2>
<section id="id30">
<h3>语法<a class="headerlink" href="#id30" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{bucket}/{object}?uploadId=123 HTTP/1.1
</pre></div>
</div>
</section>
<section id="id31">
<h3>响应内容解析<a class="headerlink" href="#id31" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">ListPartsResult</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the results.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Bucket</span></code></p></td>
<td><p>String</p></td>
<td><p>The bucket that will receive the object contents.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Key</span></code></p></td>
<td><p>String</p></td>
<td><p>The key specified by the <code class="docutils literal notranslate"><span class="pre">key</span></code> request parameter (if any).</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">UploadId</span></code></p></td>
<td><p>String</p></td>
<td><p>The ID specified by the <code class="docutils literal notranslate"><span class="pre">upload-id</span></code> request parameter identifying the multipart upload (if any).</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Initiator</span></code></p></td>
<td><p>Container</p></td>
<td><p>Contains the <code class="docutils literal notranslate"><span class="pre">ID</span></code> and <code class="docutils literal notranslate"><span class="pre">Display名称</span></code> of the user who initiated the upload.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ID</span></code></p></td>
<td><p>String</p></td>
<td><p>The initiator’s ID.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Display名称</span></code></p></td>
<td><p>String</p></td>
<td><p>The initiator’s display name.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Owner</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the <code class="docutils literal notranslate"><span class="pre">ID</span></code> and <code class="docutils literal notranslate"><span class="pre">Display名称</span></code> of the user who owns the uploaded object.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">StorageClass</span></code></p></td>
<td><p>String</p></td>
<td><p>The method used to store the resulting object. <code class="docutils literal notranslate"><span class="pre">STANDARD</span></code> or <code class="docutils literal notranslate"><span class="pre">REDUCED_REDUNDANCY</span></code></p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">PartNumberMarker</span></code></p></td>
<td><p>String</p></td>
<td><p>The part marker to use in a subsequent request if <code class="docutils literal notranslate"><span class="pre">IsTruncated</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>. Precedes the list.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">NextPartNumberMarker</span></code></p></td>
<td><p>String</p></td>
<td><p>The next part marker to use in a subsequent request if <code class="docutils literal notranslate"><span class="pre">IsTruncated</span></code> is <code class="docutils literal notranslate"><span class="pre">true</span></code>. The end of the list.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">MaxParts</span></code></p></td>
<td><p>Integer</p></td>
<td><p>The max parts allowed in the response as specified by the <code class="docutils literal notranslate"><span class="pre">max-parts</span></code> request parameter.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">IsTruncated</span></code></p></td>
<td><p>Boolean</p></td>
<td><p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, only a subset of the object’s upload contents were returned.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Part</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for <code class="docutils literal notranslate"><span class="pre">LastModified</span></code>, <code class="docutils literal notranslate"><span class="pre">PartNumber</span></code>, <code class="docutils literal notranslate"><span class="pre">ETag</span></code> and <code class="docutils literal notranslate"><span class="pre">Size</span></code> elements.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">LastModified</span></code></p></td>
<td><p>Date</p></td>
<td><p>Date and time at which the part was uploaded.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">PartNumber</span></code></p></td>
<td><p>Integer</p></td>
<td><p>The identification number of the part.</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">ETag</span></code></p></td>
<td><p>String</p></td>
<td><p>The part’s entity tag.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Size</span></code></p></td>
<td><p>Integer</p></td>
<td><p>The size of the uploaded part.</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id32">
<h2>完成分段上传<a class="headerlink" href="#id32" title="Permalink to this heading"></a></h2>
<p>组装上传的数据块并创建一个新对象，从而完成了一次分段上传。</p>
<section id="id33">
<h3>语法<a class="headerlink" href="#id33" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>POST /{bucket}/{object}?uploadId= HTTP/1.1
</pre></div>
</div>
</section>
<section id="id34">
<h3>请求实体<a class="headerlink" href="#id34" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CompleteMultipartUpload</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container consisting of one or more parts.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Part</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the <code class="docutils literal notranslate"><span class="pre">PartNumber</span></code> and <code class="docutils literal notranslate"><span class="pre">ETag</span></code>.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">PartNumber</span></code></p></td>
<td><p>Integer</p></td>
<td><p>The identifier of the part.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ETag</span></code></p></td>
<td><p>String</p></td>
<td><p>The part’s entity tag.</p></td>
<td><p>Yes</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id35">
<h3>响应内容解析<a class="headerlink" href="#id35" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>CompleteMultipartUploadResult</strong></p></td>
<td><p>Container</p></td>
<td><p>A container for the response.</p></td>
</tr>
<tr class="row-odd"><td><p><strong>Location</strong></p></td>
<td><p>URI</p></td>
<td><p>The resource identifier (path) of the new object.</p></td>
</tr>
<tr class="row-even"><td><p><strong>Bucket</strong></p></td>
<td><p>String</p></td>
<td><p>The name of the bucket that contains the new object.</p></td>
</tr>
<tr class="row-odd"><td><p><strong>Key</strong></p></td>
<td><p>String</p></td>
<td><p>The object’s key.</p></td>
</tr>
<tr class="row-even"><td><p><strong>ETag</strong></p></td>
<td><p>String</p></td>
<td><p>The entity tag of the new object.</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id36">
<h2>中止多块上传<a class="headerlink" href="#id36" title="Permalink to this heading"></a></h2>
<section id="id37">
<h3>语法<a class="headerlink" href="#id37" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>DELETE /{bucket}/{object}?uploadId= HTTP/1.1
</pre></div>
</div>
</section>
</section>
<section id="id38">
<h2>追加对象<a class="headerlink" href="#id38" title="Permalink to this heading"></a></h2>
<p>向对象追加数据。你必须有桶的写权限才能执行此操作。这是用追加模式上传文件，
“追加对象（Append Object ）”操作创建的对象类型是“可追加对象（ Appendable Object ）”，
而用“上传对象（ Put Object ）”操作上传的对象类型是“普通对象（ Normal Object ）。
<strong>如果这个桶开启或暂停了版本控制，就不能追加对象。</strong>
<strong>多站配置中，同步后会变成普通对象，但你仍然能向原始对象追加。</strong>
<strong>可追加对象的压缩和加密功能禁用了。</strong></p>
<section id="id39">
<h3>语法<a class="headerlink" href="#id39" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{bucket}/{object}?append&amp;position= HTTP/1.1
</pre></div>
</div>
</section>
<section id="id40">
<h3>请求头<a class="headerlink" href="#id40" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>Valid Values</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>content-md5</strong></p></td>
<td><p>A base64 encoded MD-5 hash of the message.</p></td>
<td><p>A string. No defaults or constraints.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>content-type</strong></p></td>
<td><p>A standard MIME type.</p></td>
<td><p>Any MIME type. Default: <code class="docutils literal notranslate"><span class="pre">binary/octet-stream</span></code></p></td>
<td><p>No</p></td>
</tr>
<tr class="row-even"><td><p><strong>x-amz-meta-&lt;…&gt;</strong></p></td>
<td><p>User metadata.  Stored with the object.</p></td>
<td><p>A string up to 8kb. No defaults.</p></td>
<td><p>No</p></td>
</tr>
<tr class="row-odd"><td><p><strong>x-amz-acl</strong></p></td>
<td><p>A canned ACL.</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">private</span></code>, <code class="docutils literal notranslate"><span class="pre">public-read</span></code>, <code class="docutils literal notranslate"><span class="pre">public-read-write</span></code>, <code class="docutils literal notranslate"><span class="pre">authenticated-read</span></code></p></td>
<td><p>No</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id41">
<h3>响应头<a class="headerlink" href="#id41" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>x-rgw-next-append-position</strong></p></td>
<td><p>Next position to append object</p></td>
</tr>
</tbody>
</table>
</section>
<section id="id42">
<h3>HTTP 响应<a class="headerlink" href="#id42" title="Permalink to this heading"></a></h3>
<p>会返回如下 HTTP 响应：</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>HTTP Status</p></th>
<th class="head"><p>Status Code</p></th>
<th class="head"><p>描述</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><strong>409</strong></p></td>
<td><p>PositionNotEqualToLength</p></td>
<td><p>Specified position does not match object length</p></td>
</tr>
<tr class="row-odd"><td><p><strong>409</strong></p></td>
<td><p>ObjectNotAppendable</p></td>
<td><p>Specified object can not be appended</p></td>
</tr>
<tr class="row-even"><td><p><strong>409</strong></p></td>
<td><p>InvalidBucketstate</p></td>
<td><p>Bucket versioning is enabled or suspended</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="retention">
<h2>设置对象的保留时长（ Retention ）<a class="headerlink" href="#retention" title="Permalink to this heading"></a></h2>
<p>给一个对象配置保留时长（ Retention ）。</p>
<section id="id43">
<h3>语法<a class="headerlink" href="#id43" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{bucket}/{object}?retention&amp;versionId= HTTP/1.1
</pre></div>
</div>
</section>
<section id="id44">
<h3>请求实体<a class="headerlink" href="#id44" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Retention</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the request.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Mode</span></code></p></td>
<td><p>String</p></td>
<td colspan="2"><p>Retention mode for the specified object. Valid Values:  GOVERNANCE/COMPLIANCE |    Yes</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">RetainUntilDate</span></code></p></td>
<td><p>Timestamp</p></td>
<td colspan="2"><p>Retention date. Format: 2020-01-05T00:00:00.000Z                              |    Yes</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id45">
<h2>查看对象的保留时长（ Retention ）<a class="headerlink" href="#id45" title="Permalink to this heading"></a></h2>
<p>查看对象的保留时长（ Retention ）配置。</p>
<section id="id46">
<h3>语法<a class="headerlink" href="#id46" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{bucket}/{object}?retention&amp;versionId= HTTP/1.1
</pre></div>
</div>
</section>
<section id="id47">
<h3>响应内容解析<a class="headerlink" href="#id47" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Retention</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the request.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Mode</span></code></p></td>
<td><p>String</p></td>
<td colspan="2"><p>Retention mode for the specified object. Valid Values:  GOVERNANCE/COMPLIANCE |    Yes</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">RetainUntilDate</span></code></p></td>
<td><p>Timestamp</p></td>
<td colspan="2"><p>Retention date. Format: 2020-01-05T00:00:00.000Z                              |    Yes</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="legal-hold">
<h2>设置对象的依法保留（ Legal Hold ）字段<a class="headerlink" href="#legal-hold" title="Permalink to this heading"></a></h2>
<p>给指定对象设置依法保留（ Legal Hold ）字段。</p>
<section id="id48">
<h3>语法<a class="headerlink" href="#id48" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>PUT /{bucket}/{object}?legal-hold&amp;versionId= HTTP/1.1
</pre></div>
</div>
</section>
<section id="id49">
<h3>请求实体<a class="headerlink" href="#id49" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">LegalHold</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the request.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Status</span></code></p></td>
<td><p>String</p></td>
<td><p>Indicates whether the specified object has a Legal Hold in place. Valid Values: ON/OFF</p></td>
<td><p>Yes</p></td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="id50">
<h2>查看对象的依法保留（ Legal Hold ）配置<a class="headerlink" href="#id50" title="Permalink to this heading"></a></h2>
<p>查看一个对象当前的依法保留（ Legal Hold ）状态。</p>
<section id="id51">
<h3>语法<a class="headerlink" href="#id51" title="Permalink to this heading"></a></h3>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>GET /{bucket}/{object}?legal-hold&amp;versionId= HTTP/1.1
</pre></div>
</div>
</section>
<section id="id52">
<h3>响应内容解析<a class="headerlink" href="#id52" title="Permalink to this heading"></a></h3>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>名称</p></th>
<th class="head"><p>类型</p></th>
<th class="head"><p>描述</p></th>
<th class="head"><p>是否必需</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">LegalHold</span></code></p></td>
<td><p>Container</p></td>
<td><p>A container for the request.</p></td>
<td><p>Yes</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Status</span></code></p></td>
<td><p>String</p></td>
<td><p>Indicates whether the specified object has a Legal Hold in place. Valid Values: ON/OFF</p></td>
<td><p>Yes</p></td>
</tr>
</tbody>
</table>
</section>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../bucketops/" class="btn btn-neutral float-left" title="桶操作" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../cpp/" class="btn btn-neutral float-right" title="S3 的 C++ 接口实例" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>